package com.zfh;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

@WebListener
public class TestListener implements HttpSessionListener{
	
	private Integer count = 0;

	@Override
	public void sessionCreated(HttpSessionEvent se) {
		count++;
		System.out.println("创建了"+count+"个用户session");
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent se) {
		count--;
		System.out.println("还有"+count+"个用户session");
	}

}
